/*
  用数组的方法输出斐波那契数列 1,2,3,5,8,13,21,34,55,89,.......写C程序,输出该数列的前N项
*/
#include <iostream>
using namespace std;

int main(int argc, char const *argv[])
{
  printf("请输入 N 的值(N <= 100)， 将列出前 N 项斐波那契数列的值:\n");

  int n;
  scanf("%d", &n);
  int arr[100] = {1, 2};

  for (int i = 2; i < n; i++)
  {
    arr[i] = arr[i - 1] + arr[i - 2];
  }

  for (int i = 0; i < n; i++)
  {
    printf("%d\n", arr[i]);
  }

  return 0;
}
